package cn.zn.wx.controller;

import cn.zn.framework.common.utils.QrCodeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("common")
@Slf4j
public class CommonController {

    @RequestMapping("qrCode")
    public void qrCode(String content, HttpServletResponse rsp) {
        QrCodeUtil qrCodeUtil = new QrCodeUtil();
        try {
            qrCodeUtil.printQrCode(content, rsp.getOutputStream());
        } catch (IOException e) {
            log.error("", e);
        }

    }
}
